const { response } = require('express');
const http = require('http');

//创建服务对象
const serve = http.createServer((request,response) => {
    //获取报文的方法
    console.log(request.method);
    console.log(request.url);
    console.log(request.httpVersion);
    console.log(request.headers);
    response.end('hello HTTP Server');
});

//3.监听端口，启动服务

serve.listen(4321 , () => {
        console.log('服务已启动……');
}, )